<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/merchantOrder/merchantOrder/orderFlow/orderFlow" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td><label style="width: 55px;">订单状态：</label> <select name="orderProcess" class="combox">
							<option value="" selected="selected"}>全部订单</option>
							<option value="0" ${requestScope.dwzPageBean.countResultMap.orderProcess == 0 ? 'selected':''}>新订单</option>
							<option value="1" ${requestScope.dwzPageBean.countResultMap.orderProcess == 1 ? 'selected':''}>已受理</option>
							<option value="2" ${requestScope.dwzPageBean.countResultMap.orderProcess == 2 ? 'selected':''}>待收货</option>
							<option value="6" ${requestScope.dwzPageBean.countResultMap.orderProcess == 6 ? 'selected':''}>退款中</option>
							<option value="7" ${requestScope.dwzPageBean.countResultMap.orderProcess == 7 ? 'selected':''}>已退货</option>
							<option value="8" ${requestScope.dwzPageBean.countResultMap.orderProcess == 8 ? 'selected':''}>取消订单</option>
							<option value="9" ${requestScope.dwzPageBean.countResultMap.orderProcess == 9 ? 'selected':''}>完成</option>
					</select></td>
					<c:forEach items="${requestScope.rolelist}" var="roles">
					<c:if test="${roles.name == '财务总监'}">
					<td><label style="width: 55px;">订单账类：</label><select name="accountType" class="combox">
							<option value="">全部账类</option>
							<option value="0" ${requestScope.dwzPageBean.countResultMap.accountType == 0 ? 'selected':''}>A帐</option>
							<option value="1" ${requestScope.dwzPageBean.countResultMap.accountType == 1 ? 'selected':''}>B帐</option>
					</select></td></c:if></c:forEach>
					<td>订单编号： <input size="25" placeholder="请输入订单编号" name="org2.orderNum" type="text" postField="orderNum" suggestFields="orderNum" suggestUrl="${pageContext.request.contextPath}/merchantOrder/merchantOrder/getOrderNum" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.orderNum}" />
					</td>
					<td>店铺名称： <input size="25" placeholder="请输入店铺名称" name="org2.shopName" type="text" postField="shopName" suggestFields="shopName" suggestUrl="${pageContext.request.contextPath}/merchantOrder/merchantOrder/getShopName" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.shopName}" />
					</td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/merchantOrder/merchantOrder/financialexport">
				<li><a href="${pageContext.request.contextPath}/merchantOrder/merchantOrder/financialexport?str=oflow" target="dwzExport" targetType="navTab" title="是要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th orderField="scontacts" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'scontacts'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系人</th>
				<th orderField="scontactNumber" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'scontactNumber'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系方式</th>
				<th orderField="sname" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sname'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺名</th>
				<th orderField="order_num" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_num'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>订单编号</th>
				<th orderField="order_process" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_process'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>订单状态</th>
				
				<th orderField="basketCount" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'basketCount'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>数量</th>
				<th orderField="saddress" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'saddress'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>详细地址</th>
				
				
				<th orderField="order_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'order_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>订单总额</th>
				<th orderField="receivable_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'receivable_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>应收金额</th>
				<th orderField="real_money" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'real_money'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>实收金额</th>
				<th orderField="pay_time" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'pay_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>支付时间</th>
				<th orderField="complete_time" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'complete_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>完成时间</th>
				<c:forEach items="${requestScope.rolelist}" var="roles">
					<c:if test="${roles.name == '财务总监'}">
						<th orderField=account_type <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'account_type'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>订单账类</th>
					</c:if>
				</c:forEach>
				<th orderField="memo"  width="150" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'memo'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>备注</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr>
						<td>${record.scontacts}</td>
						<td>${record.scontactNumber}</td>
						<td>${record.sname}</td>
						<td>${record.orderNum}</td>
						<td>${record.orderProcess == 0 ? '新订单': ''}${record.orderProcess == 1 ? '已受理': ''}${record.orderProcess == 2 ? '待收货': ''}${record.orderProcess == 6 ? '退款中': ''}${record.orderProcess == 7 ? '已退货': ''}${record.orderProcess == 8 ? '取消订单': ''}${record.orderProcess == 9 ? '完成': ''}</td>
						
						<td>${record.basketCount}</td>
						<td>${record.saddress}</td>
						
						
						<td>${record.orderMoney*0.01}</td>
						<td>${record.receivableMoney*0.01}</td>
						<td>${record.realMoney*0.01}</td>
						<td><fmt:formatDate value="${record.payTime}" pattern='yyyy-MM-dd HH:mm:ss'/></td>
						<td><fmt:formatDate value="${record.completeTime}" pattern='yyyy-MM-dd'/></td>
						<c:forEach items="${requestScope.rolelist}" var="roles">
							<c:if test="${roles.name == '财务总监'}">
								<td>${record.accountType == 0 ?'A帐':''} ${record.accountType == 1 ?'B帐':''}</td>
							</c:if>
						</c:forEach>
						<td>${record.memo}</td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>